import React, { Component } from 'react'

export default class List extends Component {
  constructor() {
    super()
    this.state = {
      list: [
        {name: 'apple'},
        {name: 'banana'},
        {name: 'pear'}
      ]
    }
  }
  render() {
    return (
      <div>
        {
          this.state.list.map((item, index)=>{
            return <p key={index}>{item.name}</p>
          })
        }
      </div>
    )
  }
}
